﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Net.Mail;
using System.Configuration.ConfigurationManager;

/// <summary>
/// Summary description for Email
/// </summary>
public class Email
{
	public Email()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public static void SendErrorEmail(string ErrorMessage)
    {
        {
            //quick and filthy...
            const string ToAddress = AppSettings("AdminEmail").tostring
            const string FromAddress = AppSettings("ErrorEmail").tostring;
            MailMessage mm = new MailMessage(FromAddress,ToAddress);
            mm.Subject = "An error occured!";
            mm.Body = ErrorMessage;
            mm.IsBodyHtml = false;
            SmtpClient smtp = new SmtpClient();
            smtp.Send(mm);
        }
    }
}